<?php

namespace app\admin\controller;

use app\common\Model\ReplyMenuModel;
use think\Controller;
class WechatMenuController extends Controller
{
    public function index(){
        $menu=new ReplyMenuModel;

        $menus=$menu->getWithSubMenu();

        $this->assign("model",$menus);

        return view();
    }

    public function update()
    {
        $post=$this->request->post();
        $data=http_mergeParams($post);
        $menu=new ReplyMenuModel;
        $result=$menu->createOrUpdate($data);
        if($result){
            return \zbcjson();
        }
        
        return \zbcjson(false,"修改失败");
    }
}